<%@page contentType="text/html; charset=UTF-8"%>
<%@taglib uri="/WEB-INF/struts-tags.tld" prefix="s"%>
<%@taglib uri="/WEB-INF/dianning.tld" prefix="dianning"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="/css/index.css" rel="stylesheet" type="text/css" />
<link href="/css/list.css" rel="stylesheet" type="text/css" />
<link href="/css/validator.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" charset="utf-8" src="/js/jquery_last.js"></script>
<script type="text/javascript" charset="utf-8" src="/js/formValidator.js"></script>
<script type="text/javascript" charset="utf-8" src="/js/formValidatorRegex.js"></script>
<link rel="shortcut icon" href="favicon.ico">
<link rel="icon" type="images/gif" href="animated_favicon1.gif" />
<title>点宁网[<dianning:webinfo type="area"/>分类信息]<dianning:webinfo type="area"/>免费发布信息<dianning:webinfo type="poweredby"/></title>
<meta name="Description" content="<dianning:webinfo type="area"/>分类信息网为您提供<dianning:webinfo type="area"/>分类信息，您可以免费发布和查询求职招聘,兼职,房屋出租,二手市场,生活服务,兼职,黄页等分类信息."/>
<meta name="Keywords" content="<dianning:webinfo type="area"/>免费发布信息, <dianning:webinfo type="area"/>分类信息, <dianning:webinfo type="area"/>信息港, <dianning:webinfo type="area"/>热线, <dianning:webinfo type="area"/>免费发布广告，<dianning:webinfo type="area"/>114"/>
</head>
<body>
<div id="login">
  <div margin:0px auto;">
<form name="add" id="add" method="post" action="message.action">
<s:hidden name="action" value="save" />
    <table width="397" border="0" cellpadding="0" cellspacing="0" id="loginbox">
	  <tr style="height:30px">
        <td width="63" height="100" class="bfont">收信人：</td>
        <td width="334">
          <input type="text" name="username" id="username" size="20" value="<s:property value="username"/>"><br><span id="usernameTip"></span>
        </td>
      </tr>
      <tr style="height:30px">
        <td width="63" height="100" class="bfont">内容：</td>
        <td width="334">
          <textarea name="message" id="message" cols="40" rows="5" class="txtbox1"><s:property value="message"/></textarea><br><span id="messageTip"></span>
        </td>
      </tr>
      <tr>
        <td height="30" class="bfont">验证码：</td>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="18%"><input name="verifycode" id="verifycode" type="text" value="" size="10" maxlength="4"></td>
              <td width="17%"><img alt="验证码" src="/authimg" id="authimg" align="absmiddle" /></td>
              <td width="65%"><a href="javascript:showAuthImg()" class="link_red">看不清楚？</a></td>
            </tr>
			<tr>
              <td colspan="3"><span id="verifycodeTip"></span></td>
            </tr>
          </table></td>
      </tr>
      <tr>
        <td height="40" colspan="2" align="center" class="bfont"><input type="submit" name="Submit" value="提交" /></td>
      </tr>
    </table>
</form>
<script type="text/javascript">        
$(document).ready(function(){
	$.formValidator.initConfig({formid:"add",errorfocus: true});
	$("#username").formValidator({onshow:"由3-20个大小写英文字母、数字组成",onfocus: "由3-20个大小写英文字母、数字组成"}).regexValidator({ regexp: "^[A-Za-z0-9_]*$", onerror: "只能输入大小写英文字母、数字" }).regexValidator({ regexp: "^(.){3,20}$", onerror: "用户名为3-20个字！" });
	$("#message").formValidator({onshow:"请输入内容",onfocus: "请输入内容" }).regexValidator({ regexp: "^(.){3,200}$", onerror: "答案应为3-200个字！" });
	$("#verifycode").formValidator({onshow:"请填写验证码",onfocus: "请填写验证码" }).regexValidator({ regexp: "^[0-9]{4}$", onerror: "验证码输入不正确" });
<s:if test="#session.code=='auto_error'">
	alert('请输入正确的验证码');
</s:if>
<s:if test="#session.code=='user_error'">
	alert('要发送消息的用户不存在');
</s:if>
<s:if test="#session.code=='message_create'">
	alert('消息发送成功');
	top.g_close_pop();
</s:if>
});
function showAuthImg(){
	var time=new Date().getTime();
	$('#authimg').attr('src','/authimg?time='+time);
}
</script>
</body>
</html>
